home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
prog_bas
/
easynet.zip
/
DEMO.ZIP
/
DIAGRAM.FRM
< prev
next >
Wrap
Text File
|
1996-01-01
|
6KB
|
246 lines
VERSION 4.00
Begin VB.Form Form3
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "Example 3: Diagrams"
ClientHeight = 3765
ClientLeft = 1095
ClientTop = 1485
ClientWidth = 5445
FillColor = &H0000FFFF&
BeginProperty Font
name = "MS Sans Serif"
charset = 1
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 4170
Left = 1035
LinkTopic = "Form3"
MDIChild = -1 'True
ScaleHeight = 3765
ScaleWidth = 5445
Tag = "3"
Top = 1140
Width = 5565
Begin VBX.EasyNet Net1
Alignment = 7 'Center - MIDDLE
AutoScroll = -1 'True
BackColor = &H00C0C0C0&
DrawColor = &H000000FF&
DrawWidth = 1
FillColor = &H0000FFFF&
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00000000&
Height = 3195
Hiding = 0 'False
ImageFile = ""
Left = 210
License = "DIAGRAM.frx":0000
MultiSel = -1 'True
ScrollBars = 3 'Both
ShowGrid = -1 'True
TabIndex = 0
Top = 300
Version = 183
Width = 3795
xGrid = 150
yGrid = 150
End
End
Attribute VB_Name = "Form3"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Dim n%, flag%
Dim Node(1 To 4) As Long
Dim X0&, Y0&
Private Sub banner3()
Net1.Transparent = True
Net1.EditAction = 0
Net1.X1 = 600
Net1.Y1 = 200
Net1.X2 = Net1.X1 + 500
Net1.Y2 = Net1.Y1 + 500
Net1.Transparent = False
Node(1) = Net1.Item
Net1.Sleeping = True
Net1.EditAction = 0
Net1.X1 = 2100
Net1.Y1 = 200
Net1.X2 = Net1.X1 + 500
Net1.Y2 = Net1.Y1 + 500
Node(2) = Net1.Item
Net1.EditAction = 0
Net1.X1 = 1600
Net1.Y1 = 1700
Net1.X2 = Net1.X1 + 500
Net1.Y2 = Net1.Y1 + 500
Node(3) = Net1.Item
Net1.EditAction = 0
Net1.X1 = 100
Net1.Y1 = 1700
Net1.X2 = Net1.X1 + 500
Net1.Y2 = Net1.Y1 + 500
Node(4) = Net1.Item
Net1.Org = Node(1)
Net1.Dst = Node(2)
Net1.EditAction = 1
Net1.Org = Node(2)
Net1.Dst = Node(3)
Net1.EditAction = 1
Net1.Org = Node(3)
Net1.Dst = Node(4)
Net1.EditAction = 1
Net1.Org = Node(1)
Net1.Dst = Node(4)
Net1.EditAction = 1
Net1.Org = Node(1)
Net1.Dst = Node(3)
Net1.EditAction = 1
Net1.Item = 0
End Sub
Private Sub Form_Activate()
ActivateForm
End Sub
Private Sub Form_Deactivate()
DeactivateForm
End Sub
Private Sub Form_Load()
MDI1.ShowExample(2).Enabled = False
n = 1
flag = False
SpeedON Net1
banner3
SpeedOFF Net1
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
CursorShape Net1
End Sub
Private Sub Form_Resize()
If WindowState <> 1 And ScaleHeight <> 0 Then
Net1.Visible = False
Net1.Top = 0
Net1.Left = 0
Net1.Height = ScaleHeight
Net1.Width = ScaleWidth
Net1.Visible = True
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
MDI1.ShowExample(2).Enabled = True
MDI1.Command5.Enabled = False
MDI1.Command5.Caption = "Comments "
End Sub
Private Sub Net1_AddLink()
If flag = True Then
flag = False
End If
End Sub
Private Sub Net1_AddNode()
' Avoid too small nodes
If Net1.X2 - Net1.X1 < 500 Then Net1.X2 = Net1.X1 + 500
If Net1.Y2 - Net1.Y1 < 500 Then Net1.Y2 = Net1.Y1 + 500
Net1.Text = Str(n)
n = n + 1
End Sub
Private Sub Net1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim l&
Select Case KeyCode
Case KEY_DELETE
Net1.EditAction = 2
Case KEY_LEFT
l = SendMessage(Net1.hWnd, WM_HSCROLL, SB_LINEUP, 0)
Case KEY_RIGHT
l = SendMessage(Net1.hWnd, WM_HSCROLL, SB_LINEDOWN, 0)
Case KEY_DOWN
l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_LINEDOWN, 0)
Case KEY_UP
l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_LINEUP, 0)
Case KEY_NEXT
l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_PAGEDOWN, 0)
Case KEY_PRIOR
l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_PAGEUP, 0)
End Select
End Sub
Private Sub Net1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Net1.PointedArea = 5 Then
flag = True
X0 = X
Y0 = Y
End If
End Sub
Private Sub Net1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
CursorShape Net1
End Sub
Private Sub Net1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Xabs, Yabs As Single
If flag = True Then
flag = False
If (Abs(X - X0) < 300 And Abs(Y - Y0) < 300) Then
Exit Sub
End If
' Origin node of next created link
Net1.Org = Net1.Item
' No current item
Net1.Item = 0
Xabs = X + Net1.xScroll
Yabs = Y + Net1.yScroll
' Create destination node
Net1.X1 = Xabs - 300
Net1.X2 = Xabs + 300
Net1.Y1 = Yabs - 300
Net1.Y2 = Yabs + 300
Net1.EditAction = 0
' Destination node of next created link
Net1.Dst = Net1.Item
' Create link
Net1.EditAction = 1
End If
End Sub